package com.example.travel.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ListView;

import androidx.fragment.app.Fragment;

import com.example.travel.Adapter.MySearchListViewAdapter;
import com.example.travel.R;

import java.util.ArrayList;

public class travel_shopping_car_fragment extends Fragment {
//    ArrayList<String> name2 = new ArrayList<>();
//    ArrayList<Integer>images2 =new ArrayList<>();
//    ArrayList<String> price2 =new ArrayList<>();
//    ArrayList<String> introduction2 = new ArrayList<>();

    @Override
    public View onCreateView( LayoutInflater inflater,  ViewGroup container,  Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.shopping_car, container, false);
        ArrayList<String> name3;
        ArrayList<Integer>images3;
        ArrayList<String> price3;
        ArrayList<String> introduction3;
        travel_list_fragment plf =new travel_list_fragment();
        name3=plf.name2;
        images3=plf.images2;
        price3=plf.price2;
        introduction3=plf.introduction2;
        ListView listView = view.findViewById(R.id.listView2);
        Button bt2=view.findViewById(R.id.bt2);
        MySearchListViewAdapter mySearchListViewAdapter =new MySearchListViewAdapter(getContext(),images3,name3,price3,introduction3);
        listView.setAdapter(mySearchListViewAdapter);
        bt2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Fragment travel_list_fragment =new travel_list_fragment();
                getFragmentManager().beginTransaction().replace(R.id.flconent,travel_list_fragment)
                        .commit();
            }
        });
        return view;
    }
}
